/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.worlds.ui.edge;

import java.awt.Color;
import java.awt.Graphics2D;
import javax.swing.JTextField;
import net.worlds.ui.CustomBorder;

/**
 *
 * @author Jacob
 */
public class ETextBox extends ESwingFrame{
    private CustomBorder border;
    public ETextBox(EComponent parent, int x, int y, int width, int height)
    {
        super(parent, x, y, width, height, null);
        component = new JTextField();
        component.setSize(getWidth(), getHeight());
        component.setBackground(new java.awt.Color(123, 128, 154));
        component.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        component.setForeground(new java.awt.Color(28, 36, 78));
        ((JTextField)component).setText("");
        border = new CustomBorder(new Color(28, 36, 78));
        component.setBorder(border);
    }
    @Override
    public void setBackgroundColor(Color c)
    {
        component.setBackground(c);
    }
    @Override
    public void setBorderColor(Color c)
    {
        border = new CustomBorder(c);
        component.setBorder(border);
    }
    public void setTextColor(Color c)
    {
        component.setForeground(c);
    }
    public void setText(String text)
    {
        ((JTextField)component).setText(text);
    }
    public String getText()
    {
        if(component != null)
            return ((JTextField)component).getText();
        return "";
    }
    @Override
    public void render(Graphics2D g)
    {
        getX();
    }
}
